package com.adups.monitor.utils;

import java.security.SecureRandom;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


import org.apache.commons.lang.StringUtils;

public class StaticMethod {


	
	/**
     * 验证邮箱
     * @param email
     * @return
     */
	/**
	 * 
	 * @param emailx
	 * @return
	 */
	public static boolean chackEmailAdress(String emailx) {
		if(StringUtils.isBlank(emailx) || emailx.length()>40){
			return false;
		}
		if("无".equals(emailx)){
			return true;
		}
		String email = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
		Pattern regex = Pattern.compile(email);
		Matcher matcher = regex.matcher(emailx.trim());
		return matcher.matches();
	}
}
